﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace NinjaToolbox.SubComponentModule
{
    public sealed class UnionSerializeReader
    {
        Queue<Union> mQueue;


        public UnionSerializeReader(Queue<Union> queue)
        {
            mQueue = queue;
        }

        public Union Read()
        {
            return mQueue.Dequeue();
        }

        public int ReadInt()
        {
            return mQueue.Dequeue().intValue;
        }

        public float ReadFloat()
        {
            return mQueue.Dequeue().floatValue;
        }

        public bool ReadBool()
        {
            return mQueue.Dequeue().boolValue;
        }

        public string ReadString()
        {
            return mQueue.Dequeue().stringValue;
        }
    }
}
